import Vue from "vue"
import VueRouter from 'vue-router'
import Mymain from '../view/Mymain.vue'
import Login from '../view/Login.vue'
import Home from '../view/Home.vue'
import User from '../view/User.vue'
import Mall from '../view/Mall.vue'
import Two from '../view/Two.vue'
import One from '../view/One.vue'
Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

const router = new VueRouter({
  mode:'history',
  routes:[
    {
     path:'/',
     component:Mymain,
     name:'mymain',
     redirect:'/home',
     children:[
      
     ]
    },
    {
      path:'/login',
      name:'login',
      component:Login,
    }
  ]
})

export default router